package com.sunshin.staticfactorymethod;

/**
 * 动物的静态工厂方法
 *
 * @Author: WeiHong
 * @Date: 2017/3/28 10:17
 */
public class Animal {

    private String description;

    private Animal(String description){
        this.description = description;
    }

    private static final Animal dog = new Animal("狗");
    private static final Animal cat = new Animal("猫");

    public static final Animal getDog(){
        return dog;
    }

    public static final Animal getCat(){
        return cat;
    }


    public String getDescription() {
        return description;
    }
}
